package com.zjlanyun.erp.network;

import java.util.HashMap;

import com.zjlanyun.erp.Common;
import com.zjlanyun.erp.config.AppConfig;

import android.content.Context;

public class WebApi {

	public static final String URL_PREFIX = "http://";
	//新版本检查地址
	public static final String VERSION_URL = "http://appupdate.zjlanyun.com:880/app.php?m=customer&a=get_last_version";

	/**
	 * 用户
	 * @return
	 */
	public static String user(){
		return URL_PREFIX + AppConfig.getInstance().getString("serverUrl","") + "/user.aspx";
	}

	/**
	 * 生产管理
	 * @return
	 */
	public static String production(){
		return URL_PREFIX + AppConfig.getInstance().getString("serverUrl","") + "/production.aspx";
	}

	/**
	 * 报表
	 * @return
	 */
	public static String report(){
		return URL_PREFIX + AppConfig.getInstance().getString("serverUrl","") + "/report.aspx";
	}

	/**
	 * 仓库管理
	 * @return
	 */
	public static String warehouse(){
		return URL_PREFIX + AppConfig.getInstance().getString("serverUrl","") + "/warehouse.aspx";
	}






	
	/**
	 * 客户管理
	 * @param context
	 * @return
	 */
	public static String customer(Context context){
		HashMap<String, Object> userinfo = Common.getUserinfo(context);
		return URL_PREFIX + userinfo.get("serverUrl") + "/customer.aspx";
	}
	
	/**
	 * 通讯录
	 * @param context
	 * @return
	 */
	public static String addressbook(Context context){
		HashMap<String, Object> userinfo = Common.getUserinfo(context);
		return URL_PREFIX + userinfo.get("serverUrl") + "/addressbook.aspx";
	}




	/**
	 * 绑定设备，检测绑定
	 * @return
     */
	public static String deviceBind(){
		return URL_PREFIX + "appupdate.zjlanyun.com:880/app.php?g=api&m=customer&a=bind";
	}

	/**
	 * 解绑设备
	 * @return
     */
	public static String device_unbind(){
		return URL_PREFIX + "appupdate.zjlanyun.com:880/app.php?g=api&m=customer&a=unbind";
	}

	/**
	 * 设备退出
	 * @return
     */
	public static String device_logout(){
		return URL_PREFIX + "appupdate.zjlanyun.com:880/app.php?g=api&m=customer&a=logout";
	}
}
